<template>
  <div class="winning_record_page">
    <van-nav-bar title="中奖记录"
                 left-arrow
                 @click-left="onClickLeft()"
                 right-text="编辑"
                 @click-right="onClickRight()"
    />
    <div class="tab_content">
      <winning-record-item v-for="(items, index) in winningRecordInfo"
                           :key="index"
                           :activityTitle="items.luckyDraw.title || '幸运大抽奖'"
                           :imageUrl="items.prizeVO.imgUrl"
                           :prizeInfoName = "items.prizeVO.prizeName"
      ></winning-record-item>
    </div>
  </div>
</template>

<script>
import {NavBar, SwipeCell} from "vant";
import WinningRecordItem from "views/TabbarMain/Personal/components/WinningRecordItem";
import {myLuckWin} from "@/api/lucky";

export default {
  name: "WinningRecord",
  components: {
    [NavBar.name]: NavBar,
    [SwipeCell.name]: SwipeCell,
    WinningRecordItem
  },
  data(){
    return {
      winningRecordInfo: []
    }
  },
  created() {
    myLuckWin({pageNum: 1, pageSize: 999}).then(res => {
      this.winningRecordInfo = res.data.list;
    })
  },
  methods:{
    onClickLeft() {
      this.$router.go(-1);
    },
    onClickRight() {

    }
  }
}
</script>

<style scoped>
  .winning_record_page{
    background-color: rgb(247, 246, 251);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
  }
  .tab_content{
    padding-top: 5px;
    padding-left: 5px;
    padding-right: 5px;
  }
</style>
